package item.inkcloud.distributionservice.controller;


import item.inkcloud.distributionservice.service.DistributionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;


@RestController
@RequestMapping("/distribution")
public class DistributionController {

    @Autowired
    DistributionService distributionService;

    @RequestMapping("/provinceInfo")
    HashMap provinceInfo(){

        HashMap<String ,Object> resultMap = new HashMap<String, Object>();

        ArrayList resultData = distributionService.getProvinceInfo();
        if (resultData!=null){
            resultMap.put("status",1);
            resultMap.put("data",resultData);

        }else {
            resultMap.put("status",0);
        }

        return resultMap;
    }

}
